package yw.substart.example.controller;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpServletRequest;

/**
 * @author lwq
 * @date 2018/5/17
 * @comment
 */
@Controller
public class IndexController extends BaseController {

    private final Logger logger = LoggerFactory.getLogger(IndexController.class);

    @RequestMapping("/index")
    public String index(ModelMap modelMap, HttpServletRequest request) {
        modelMap.put("basePath", request.getServerName()+":"+request.getServerPort()+request.getContextPath());
        return "index.html";
    }

    @RequestMapping("/ws")
    public String ws() {
        return "ws.html";
    }

}
